<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="/commons/commonList.jsp"%>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<title></title>
<script type="text/javascript">

var currentdispatchFormId="";

    function setCurrentdispatchFormId(id){
    currentdispatchFormId=id;
    }

	function refleshFrame(){
		var url = "${ctx}/customerService_dispatchFormAction.do?method=queryDispatchFormByPage&ec_crd=15&deptId=${deptId}";
		document.getElementById("customerDispatchFormList").src = url;
	}

	/**
	*增加派工单
	*/
	function addDispatchForm(){
	  if('${customerEventId}'==''){
	  Alert('该角色不能进行创建派工单!');
	  return false;
	  }
	  var url = "${ctx}/customerService_dispatchFormAction.do?method=navigateDispatchFormAdd&customerEventId=${customerEventId}";
		top.windowOpen(url, "addDispatchForm", "创建派工单", 400, 650,true,"addDispatchForm");

	}

   /**
	*作废
	*/
	function disannulDispatchForm(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	  var urll = "${ctx}/customerService_dispatchFormAction.do?method=checkIsAllowSetAsideDispatchForm&dispatchFormId="+currentdispatchFormId;
	 new Ajax.Request(urll,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		var url = "${ctx}/customerService_dispatchFormAction.do?method=navigateDispatchFormDisannul&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "disannulDispatchForm", "作废", 270, 410,true,"disannulDispatchForm");


		}}
	 );

	}

	function dispatchFormDetail(){

	var url = "${ctx}/customerService_dispatchFormAction.do?method=navigateDispatchFormDetail&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "dispatchFormDetail", "派工单详细信息", 550, 850,true,"dispatchFormDetail");

	}

	/**
	*接单登记
	*/
	function dispatchingAdd(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	   var urll = "${ctx}/customerService_dispatchFormAction.do?method=checkIsAllowDispatching&dispatchFormId="+currentdispatchFormId;
	 new Ajax.Request(urll,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		var url = "${ctx}/customerService_dispatchFormAction.do?method=navigateReceiveDispatchForm&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "dispatchingAdd", "接单登记", 230, 550,true,"dispatchingAdd");


		}}
	 );


	}

	/**
	*费用清单
	*/
	function chargeItemManage(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	var url = "${ctx}/customerService_dispatchFormAction.do?method=navigateChargeItemManage&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "chargeItemManage", "费用清单", 350, 850,true,"chargeItemManage");

	}

	/**
	*费用核算
	*/
	function chargeCalculate(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	var url = "${ctx}/customerService_custServiceChargeAction.do?method=navigateChargeCalculateMain&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "chargeCalculate", "费用核算", 400, 900,true,"chargeCalculate");

	}

	/**
	*反馈管理
	*/
	function feedbackRecord(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	var url = "${ctx}/customerService_feedbackRecordAction.do?method=navigateFeedbackRecordMain&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "feedbackRecord", "反馈管理", 460, 850,true,"feedbackRecord");

	}

    /**
	*派工单打印
	*/
	function showReport(){
		var url = "${ctx}/applets/appletShow.jsp?reportName=dispatchForm&dispatchFormId="+currentdispatchFormId;
//		top.windowOpen(url, "showReport", "派工单",660,750,true,"showReport");
window.open (url);

		//660,750

	}

   /**
   * 提交查询
   */
  function submitSearch(){

  	document.searchCustomerdispatch.submit();

  }

  function keySubmitSearch(){
    if(event.keyCode==13){
    submitSearch();
     }
  }

</script>

</head>
<body style="overflow: auto;">

<div class="pageNav_bg">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td width="50" id="pageNav_leftimg">
     	<img src="${ctx}/images/ico_custome_sq.gif" width="46" height="47"/>
     </td>
      <td id="navWord"><span class="page_title">派工单管理</span></td>
      <td class="pageNav_right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      	<a href="javascript:showFull_in();">
      		<img id="full_image"  src="${ctx}/images/ico_fullscreen.gif" border="0"/>
      	</a>
    </tr>
  </table>
</div>

<div class="container">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td class="bg_search2">
<!-----------------------------搜索1----------------------------->
 <table border="0" cellpadding="0" cellspacing="1">
 <form action="${ctx}/customerService_dispatchFormAction.do?method=queryDispatchFormByPage&ec_crd=15"
	   		 id="searchCustomerdispatch" name="searchCustomerdispatch" method="post" target="customerDispatchFormList">
   <input type="hidden" name="deptId" value="${deptId}">
   <tr>
     <td class="td_search align_left">房 号：</td>
     <td class="td_search align_left"><input name="houseNumber" type="text" class="inputtext" value="" size="16" onKeyPress="keySubmitSearch();"/></td>
     <td class="td_search align_left">派工单号：</td>
     <td class="td_search align_left"><input name="dispatchNo" type="text" class="inputtext" value="" size="16" onKeyPress="keySubmitSearch();"/></td>
     </td>
     <td class="td_search align_left"> 服务内容：</td>
     <td class="td_search align_left"><input name="serviceContent" type="text" class="inputtext" value="" size="16" onKeyPress="keySubmitSearch();"/></td>
     <td class="td_search"><table border="0" cellpadding="0" cellspacing="0" >
         <tr>
           <td class="buttonOffLeft" id="btn1_91"></td>
           <td class="buttonOffMiddle" id="btn1_92" onblur="btn_change(9)" onMouseOver="btn_change_over(9)" onMouseOut="btn_change_out(9)" onclick="submitSearch();"><img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle" /> 查
             询</td>
           <td class="buttonOffRight" id="btn1_93"></td>
         </tr>
     </table></td>
   </tr>
   </form>
      </table>	  </td>
    </tr>
    <tr>
      <td class="bg_toolBar"></td>
    </tr>
    <tr>
    <td valign="top">
		<iframe id="customerDispatchFormList"  name="customerDispatchFormList" height="300px" frameborder="0" border="0" src="${ctx}/customerService_dispatchFormAction.do?method=queryDispatchFormByPage&mainFlat=true&ec_crd=15&deptId=${deptId}" width="100%" ></iframe>
      </td>
    </tr>
  </table>
</div>

</body>
</html>
